﻿using UnityEditor;
using UnityEngine;
using System.Collections;

[CustomEditor(typeof(USSpawnPrefabEvent))]
public class USSpawnPrefabEventEditor : USEventBaseEditor
{
	new public Rect RenderEvent(Rect myArea, USEventBase thisEvent)
	{
		USSpawnPrefabEvent spawnEvent = thisEvent as USSpawnPrefabEvent;

		if (!spawnEvent)
            Debug.LogWarning("此事件不是USSpawnPrefabEvent类型, 而是 : " + thisEvent.GetType().ToString());

		DrawDefaultBox(myArea, thisEvent);

		GUILayout.BeginArea(myArea);
			GUILayout.Label("创建预制件 : ", defaultBackground);
			if (spawnEvent)
				GUILayout.Label(spawnEvent.spawnPrefab?spawnEvent.spawnPrefab.name:"null", defaultBackground);
			GUILayout.Label("在 : ", defaultBackground);
			GUILayout.Label(spawnEvent.spawnTransform?spawnEvent.spawnTransform.name:"（0,0,0）", defaultBackground);
		GUILayout.EndArea();

		return myArea;
	}
}
